import platform = require('../../../../../platform/common/baseCommon');
import bpServer = require('../../../../../platform/server/bpServer');
import tpServer = require('../../../../../platform/server/smsplatformService');
import appServer = require('../../../../../platform/server/appServer');
import example = require('./gsfxInfoConfig');
import example2 = require('./tzrjbtzAnalysysConfig');
//import path = require('path');

// 启动应用
export let app = new appServer.serverApplication();

app.port = 3000;

//配置https
app.httpsConfig = new appServer.httpsConfig();
app.httpsConfig.port = 3001;
app.httpsConfig.privateKeyPath = './ssl/server.key';
app.httpsConfig.certificatePath = "./ssl/server.crt";
app.httpsConfig.codogram = 'utf-8';

let userLoginService = new bpServer.UserLoginService();//登录服务
let sendcodeService = new tpServer.yunpianService();//发送验证码服务
userLoginService.featureController = new appServer.serviceFeatureController();
// userLoginService.featureController.features = [
//     {
//         owner: 'sysadmin',
//         ownerType: 'role',
//         content: 'logout',
//         effect: 'grant',
//         targetType: 'ServiceMethod'
//     }
// ];
app.services = [
    {
        serviceName: 'databaseLogService',  // 数据库日志服务
        serviceObject: new appServer.databaseLogger()
    },
    {
        serviceName: 'fileLogService',      // 文件日志服务
        serviceObject: new appServer.fileLogger()
    },
    {
        serviceName: 'loginService',//登录服务
        serviceObject: userLoginService
    },
    {
        serviceName: 'getcodeService',//获取验证码服务
        serviceObject: sendcodeService
    },
    example.dataServiceInfo,
    example2.dataServiceInfo
];

app.serverLogger = new appServer.databaseLogger();
